<template>
  <div class="container">
    <el-dialog
      title="商超手持差异单详情"
      :visible.sync="dialog.dialogVisible"
      @open="getData"
       width="1200px"
      @close="confirm"
      center
    >
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
       <el-table-column
          prop="goods_code"
          label="商品编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="goods_name"
          label="商品名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="before_num"
          label="库存数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="before_amount"
          label="库存金额"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="real_num"
          label="盘点数量"
          align="center"
        ></el-table-column>
          <el-table-column
          prop="type_text"
          label="差异类型"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="diff_num"
          label="差异数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="house_code"
          label="仓库编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="house_name"
          label="仓库名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="spec"
          label="规格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="unit"
          label="单位"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="class_code"
          label="分类编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="class_name"
          label=" 分类名称"
          align="center"
        ></el-table-column>
      
       
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { diffDetail } from "@/api/check/superCheck.js";
export default {
  props: {
    dialog: Object
  },
  data() {
    return {
      tableData: []
    };
  },
  created() {},
  methods: {
    //关闭
    confirm() {
      this.dialog.dialogVisible = false;
    },
    // 获取数据
    getData() {
      this.tableData = [];
      this.center = [];
      let data = {
        id: this.dialog.id
      };
      diffDetail(data).then(res => {
        if (res.code == 0) {
          this.tableData = res.data.goods;
        }
      });
    }
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
  background-size: cover;
}
</style>
